package vector

type Iterator[T any] struct {
	v     *Vector[T]
	point int
}

func NewIterator[T any](start *Vector[T]) *Iterator[T] {
	return &Iterator[T]{
		v:     start,
		point: 0,
	}
}
func (i *Iterator[T]) Check() bool {
	if _, err := i.v.At(i.point); err == nil {
		return true
	}
	return false
}
func (i *Iterator[T]) Next() {
	i.point++
}

func (i *Iterator[T]) Value() T {
	res, _ := i.v.At(i.point)
	return res
}
